for i in range(1,10):
    for j in range(9-i):
        print('        ',end='')
    for k in range(i,0,-1):
        print("{}*{}={:<4}".format(k,i,k*i),end='')
    print()
print('='*100)
i=1
while i<10:
    j=0
    while j<9-i:
        print(' '*8,end='')
        j+=1
    k=i
    while k>0:
        print("{}*{}={:<4}".format(k,i,k*i),end='')
        k-=1
    print()
    i+=1
print('='*100)
for i in range(9,-1,-1):
    for j in range(9-i):
        print(' '*8,end='')
    for k in range(i,0,-1):
        print("{}*{}={:<4}".format(k, i, k * i), end='')
    print()
print('='*100)
i=9
while i>0:
    j=0
    while j<9-i:
        print(' '*8,end='')
        j+=1
    k=i
    while k>0:
        print("{}*{}={:<4}".format(k, i, k * i), end='')
        k-=1
    print()
    i-=1
